home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / sun3.md / RCS / a.out.h,v < prev    next >
Encoding:
Text File  |  1991-11-15  |  5.9 KB  |  342 lines

  1. head     1.13;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.13
  10. date     91.11.14.21.39.08;  author kupfer;  state Exp;
  11. branches ;
  12. next     1.12;
  13.  
  14. 1.12
  15. date     90.12.07.23.47.20;  author rab;  state Exp;
  16. branches ;
  17. next     1.11;
  18.  
  19. 1.11
  20. date     90.10.26.01.15.26;  author rab;  state Exp;
  21. branches ;
  22. next     1.10;
  23.  
  24. 1.10
  25. date     90.02.16.14.02.26;  author rab;  state Exp;
  26. branches ;
  27. next     1.9;
  28.  
  29. 1.9
  30. date     89.12.16.01.12.41;  author mendel;  state Exp;
  31. branches ;
  32. next     1.8;
  33.  
  34. 1.8
  35. date     89.07.31.18.09.44;  author jhh;  state Exp;
  36. branches ;
  37. next     1.7;
  38.  
  39. 1.7
  40. date     89.07.17.15.14.53;  author mgbaker;  state Exp;
  41. branches ;
  42. next     1.6;
  43.  
  44. 1.6
  45. date     89.06.19.14.13.14;  author jhh;  state Exp;
  46. branches ;
  47. next     1.5;
  48.  
  49. 1.5
  50. date     89.03.12.14.06.40;  author mendel;  state Exp;
  51. branches ;
  52. next     1.4;
  53.  
  54. 1.4
  55. date     88.09.02.08.37.17;  author ouster;  state Exp;
  56. branches ;
  57. next     1.3;
  58.  
  59. 1.3
  60. date     88.08.01.08.14.18;  author ouster;  state Exp;
  61. branches ;
  62. next     1.2;
  63.  
  64. 1.2
  65. date     88.07.28.11.28.08;  author ouster;  state Exp;
  66. branches ;
  67. next     1.1;
  68.  
  69. 1.1
  70. date     88.07.02.17.06.10;  author ouster;  state Exp;
  71. branches ;
  72. next     ;
  73.  
  74.  
  75. desc
  76. @@
  77.  
  78.  
  79. 1.13
  80. log
  81. @Add RCS Header line.
  82. @
  83. text
  84. @/*
  85.  * Copyright (c) 1980 Regents of the University of California.
  86.  * All rights reserved.  The Berkeley software License Agreement
  87.  * specifies the terms and conditions for redistribution.
  88.  *
  89.  *    @@(#)a.out.h    5.2 (Berkeley) 4/7/87
  90.  * $Header$ SPRITE (Berkeley)
  91.  */
  92.  
  93. /*
  94.  * Definitions of the a.out header
  95.  * and magic numbers are shared with
  96.  * the kernel.
  97.  */
  98. #ifndef _AOUT
  99. #define _AOUT
  100.  
  101. #include <sun3.md/sys/exec.h>
  102.  
  103. extern int Aout_PageSize[];
  104.  
  105. /*
  106.  * Macro to tell whether or not the magic number in an a.out file
  107.  * is an illegal one.
  108.  */
  109.  
  110. #define    N_BADMAG(x) \
  111.     (((x).a_magic)!=OMAGIC && \
  112.      ((x).a_magic)!=NMAGIC && \
  113.      ((x).a_magic)!=ZMAGIC && \
  114.      ((x).a_magic)!=SPRITE_ZMAGIC && \
  115.      ((x).a_magic)!=UNIX_ZMAGIC)
  116.  
  117. /*
  118.  * Macros to tell where various pieces of information start in the
  119.  * a.out file.
  120.  */
  121.  
  122. #define N_PAGSIZ(x) (Aout_PageSize[(x).a_machtype])
  123.  
  124. #define N_TXTOFF(x) \
  125.     (((x).a_magic==ZMAGIC || (x).a_magic==UNIX_ZMAGIC) \
  126.         ? 0 : sizeof (struct exec))
  127. #define N_SYMOFF(x) \
  128.     (N_TXTOFF(x) + (x).a_text+(x).a_data + (x).a_trsize + (x).a_drsize)
  129. #define    N_STROFF(x) \
  130.     (N_SYMOFF(x) + (x).a_syms)
  131.  
  132. /*
  133.  * Macros to tell where the various segments start in virtual memory,
  134.  * when the process is loaded.
  135.  */
  136. #include <sun3.md/kernel/procMach.h>
  137.  
  138. #define N_TXTADDR(x) PROC_CODE_LOAD_ADDR(*((ProcExecHeader *) &(x)))
  139. #define N_DATADDR(x) PROC_DATA_LOAD_ADDR(*((ProcExecHeader *) &(x)))
  140. #define N_BSSADDR(x) PROC_BSS_LOAD_ADDR(*((ProcExecHeader *) &(x)))
  141.  
  142. /*
  143.  * Format of a relocation datum.
  144.  */
  145. struct relocation_info {
  146.     int    r_address;    /* address which is relocated */
  147. unsigned int    r_symbolnum:24,    /* local symbol ordinal */
  148.         r_pcrel:1,     /* was relocated pc relative already */
  149.         r_length:2,    /* 0=byte, 1=word, 2=long */
  150.         r_extern:1,    /* does not include value of sym referenced */
  151.         :4;        /* nothing, yet */
  152. };
  153.  
  154. /*
  155.  * Format of a symbol table entry; this file is included by <a.out.h>
  156.  * and should be used if you aren't interested the a.out header
  157.  * or relocation information.
  158.  */
  159. struct    nlist {
  160.     union {
  161.         char    *n_name;    /* for use when in-core */
  162.         long    n_strx;        /* index into file string table */
  163.     } n_un;
  164. unsigned char    n_type;        /* type flag, i.e. N_TEXT etc; see below */
  165.     char    n_other;    /* unused */
  166.     short    n_desc;        /* see <stab.h> */
  167. unsigned long    n_value;    /* value of this symbol (or sdb offset) */
  168. };
  169. #define    n_hash    n_desc        /* used internally by ld */
  170.  
  171. /*
  172.  * Simple values for n_type.
  173.  */
  174. #define    N_UNDF    0x0        /* undefined */
  175. #define    N_ABS    0x2        /* absolute */
  176. #define    N_TEXT    0x4        /* text */
  177. #define    N_DATA    0x6        /* data */
  178. #define    N_BSS    0x8        /* bss */
  179. #define    N_COMM    0x12        /* common (internal to ld) */
  180. #define    N_FN    0x1e        /* file name symbol */
  181.  
  182. #define    N_EXT    01        /* external bit, or'ed in */
  183. #define    N_TYPE    0x1e        /* mask for all the type bits */
  184.  
  185. /*
  186.  * Sdb entries have some of the N_STAB bits set.
  187.  * These are given in <stab.h>
  188.  */
  189. #define    N_STAB    0xe0        /* if any of these bits set, a SDB entry */
  190.  
  191. /*
  192.  * Format for namelist values.
  193.  */
  194. #define    N_FORMAT    "%08x"
  195.  
  196. #endif /* _AOUT */
  197. @
  198.  
  199.  
  200. 1.12
  201. log
  202. @Unix compatibilty.
  203. @
  204. text
  205. @d7 1
  206. @
  207.  
  208.  
  209. 1.11
  210. log
  211. @Fixed definition of N_BSSADDR.
  212. @
  213. text
  214. @d27 5
  215. a31 1
  216.     (((x).a_magic)!=OMAGIC && ((x).a_magic)!=NMAGIC && ((x).a_magic)!=ZMAGIC)
  217. d41 2
  218. a42 1
  219.     ((x).a_magic==ZMAGIC ? 0 : sizeof (struct exec))
  220. @
  221.  
  222.  
  223. 1.10
  224. log
  225. @Fixed include path, so that this file can be used by a cross-compiler.
  226. @
  227. text
  228. @d51 1
  229. a51 1
  230. #define N_BSSADDR(x) PROC_DATA_BSS_ADDR(*((ProcExecHeader *) &(x)))
  231. @
  232.  
  233.  
  234. 1.9
  235. log
  236. @Added (ProcExecHeader *) cast to N_TXTADDR macros.
  237. @
  238. text
  239. @d17 1
  240. a17 1
  241. #include <sys/exec.h>
  242. d47 1
  243. a47 1
  244. #include <kernel/procMach.h>
  245. @
  246.  
  247.  
  248. 1.8
  249. log
  250. @added cast of struct exec to ProcExecHeader
  251. @
  252. text
  253. @d49 1
  254. a49 1
  255. #define N_TXTADDR(x) PROC_CODE_LOAD_ADDR(x)
  256. d51 1
  257. a51 1
  258. #define N_BSSADDR(x) PROC_DATA_BSS_ADDR(x)
  259. @
  260.  
  261.  
  262. 1.7
  263. log
  264. @Removed references to nonexistent procAOUT.h header file.
  265. @
  266. text
  267. @d50 1
  268. a50 1
  269. #define N_DATADDR(x) PROC_DATA_LOAD_ADDR(x)
  270. @
  271.  
  272.  
  273. 1.6
  274. log
  275. @added ifdef _AOUT
  276. @
  277. text
  278. @d47 1
  279. a47 1
  280. #include <kernel/procAOUT.h>
  281. d49 3
  282. a51 3
  283. #define N_TXTADDR(x) PROC_CODE_LOAD_ADDR(*(Proc_AOUT *) &(x))
  284. #define N_DATADDR(x) PROC_DATA_LOAD_ADDR(*(Proc_AOUT *) &(x))
  285. #define N_BSSADDR(x) PROC_DATA_BSS_ADDR(*(Proc_AOUT *) &(x))
  286. @
  287.  
  288.  
  289. 1.5
  290. log
  291. @Modified the N_* macro's to use the same macro's as the kernel code.
  292. @
  293. text
  294. @d14 3
  295. d106 2
  296. @
  297.  
  298.  
  299. 1.4
  300. log
  301. @Defined N_TXTADDR etc.
  302. @
  303. text
  304. @d44 1
  305. d46 3
  306. a48 3
  307. #define N_TXTADDR(x) N_PAGSIZ(x)
  308. #define N_DATADDR(x) (N_TXTADDR(x) + (x).a_text)
  309. #define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data)
  310. @
  311.  
  312.  
  313. 1.3
  314. log
  315. @Renamed N_PAGESIZE to N_PAGSIZ for compatibility.
  316. @
  317. text
  318. @d41 9
  319. @
  320.  
  321.  
  322. 1.2
  323. log
  324. @N_TXTOFF was wrong:  it was set for VAXes, not for Sprite.
  325. @
  326. text
  327. @d31 1
  328. a31 1
  329. #define N_PAGESIZE(x) (Aout_PageSize[(x).a_machtype])
  330. @
  331.  
  332.  
  333. 1.1
  334. log
  335. @Initial revision
  336. @
  337. text
  338. @d34 1
  339. a34 1
  340.     ((x).a_magic==ZMAGIC ? N_PAGESIZE(x) : sizeof (struct exec))
  341. @
  342.